home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / prospero / propsero.lha / prospero-beta.4.2e / user / pfs.c < prev    next >
C/C++ Source or Header  |  1992-02-10  |  1KB  |  57 lines

  1. /*
  2.  * Copyright (c) 1989, 1990, 1991 by the University of Washington
  3.  *
  4.  * For copying and distribution information, please see the file
  5.  * <uw-copyright.h>.
  6.  */
  7.  
  8. #include <uw-copyright.h>
  9.  
  10. #include <stdio.h>
  11.  
  12. #include <pfs.h>
  13. #include <pcompat.h>
  14. #include <pmachine.h>
  15.  
  16. char    *getenv();
  17. char    *rindex();
  18.  
  19. main()
  20.     {
  21.     char    *pfs_defst;
  22.     char    *sitename;
  23.     char    *vsname;
  24.     char    *homedir;
  25.     char    *workdir;
  26.     int    pfs_defint = -1;
  27.  
  28.     pfs_defst = getenv("PFS_DEFAULT");
  29.     if(pfs_defst) {
  30.         sscanf(pfs_defst,"%d",&pfs_defint);
  31.         if(pfs_defint == PMAP_DISABLE) pfs_defst = "Disabled";
  32.         else if(pfs_defint == PMAP_ENABLE) pfs_defst = "Always";
  33.         else if(pfs_defint == PMAP_COLON) pfs_defst = "On colon";
  34.         else if(pfs_defint == PMAP_ATSIGN_NF) pfs_defst = "Enabled";
  35.         else if(pfs_defint == PMAP_ATSIGN) pfs_defst = "Enabled (won't fall through)";
  36.         else pfs_defst = "<status unknown>";
  37.     }
  38.     else pfs_defst = "<at program's option>";
  39.  
  40.     sitename = pget_vsname();
  41.     vsname = NULL;
  42.     homedir = pget_hd();
  43.     workdir = pget_wd();
  44.  
  45.     if(sitename) sitename = stcopy(sitename);
  46.     if(sitename) {
  47.         vsname = rindex(sitename,'/');
  48.         *(vsname++) = '\0';
  49.     }
  50.  
  51.     printf("Prospero Name Resolution: %s\n",pfs_defst);
  52.     if(sitename) printf("                    Site: %s\n",sitename);
  53.     if(vsname)   printf("                    Name: %s\n",vsname);
  54.     if(homedir)  printf("          Home Directory: %s\n",homedir);
  55.     if(workdir)  printf("       Working Directory: %s\n",workdir);
  56.     }
  57.